<div class="page page-table" data-ng-controller="contentCtr">
    <section class="panel panel-default table-dynamic">
        <div class="panel-heading"><strong><span class="glyphicon glyphicon-th"></span>内容列表</strong></div>

        <div class="table-filters">
            <div class="row">
                <div class="col-sm-4 col-xs-6">
                    <form>
                        <input type="text"
                               placeholder="搜索..."
                               class="form-control"
                               data-ng-model="searchKeywords"
                               data-ng-keyup="search()">
                    </form>

                </div>
                <div class="col-sm-3" >
                    <select class="form-control" id="province" data-ng-model="selectedMenu.menuId"
                            data-ng-options="_menu.menuId as _menu.menuName for _menu in menus" ng-change="changeMenu()"></select>
                </div>

                <div class="col-sm-3 col-xs-6 filter-result-info">
                    <span>
                        Showing {{filteredStores.length}}/{{stores.length}} entries
                    </span>
                </div>

            </div>
        </div>

        <table class="table table-bordered table-striped table-responsive">
            <thead>
            <tr>
                <th>
                    <div class="th">
                        名称
                    </div>
                </th>
                <th>
                    <div class="th">
                        简介
                    </div>
                </th>
                <th>
                    <div class="th">
                        类型
                    </div>
                </th>
                <th>
                    <div class="th">
                        所属子菜单
                    </div>
                </th>
                <th>
                    <div class="th">
                        更新时间
                    </div>
                </th>
                <th>
                    <div class="th">
                        操作
                    </div>
                </th>
            </tr>
            </thead>
            <tbody>
            <tr  data-ng-repeat="store in currentPageStores">
                <td style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{store.contentName}}</td>
                <td style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{store.contentSummary}}</td>
                <td style="">{{store.contentType == 'video' ? '视频' : '文章|新闻'}}</td>
                <td style="">
                    {{store.menuName}}
                </td>
                <td style="">
                    {{store.contentUpdateAt | date:'yyyy-MM-dd HH:mm:ss' }}
                </td>
                <td style="">
                    <a type="button" class="btn btn-w-md btn-gap-v btn-primary" href="#/contents/edit/{{store.contentId}}">编辑
                    </a>
                    <button type="button" class="btn btn-w-md btn-gap-v btn-danger" ng-click="deleteContent(store)">删除
                    </button>

                </td>
            </tr>
            </tbody>
        </table>
        <script type="text/ng-template" id="deleteModalContent.html">
            <div class="modal-header">
                <h3>删除</h3>
            </div>
            <div class="modal-body">
                确定删除 {{data.name}} ?
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" ng-click="ok()">OK</button>
                <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
            </div>
        </script>
        <footer class="table-footer">
            <div class="row">
                <div class="col-md-12 text-right pagination-container">
                    <uib-pagination class="pagination-sm"
                                    ng-model="currentPage"
                                    total-items="filteredStores.length"
                                    max-size="4"
                                    ng-change="select(currentPage)"
                                    items-per-page="numPerPage"
                                    rotate="false"
                                    previous-text="&lsaquo;" next-text="&rsaquo;"
                                    boundary-links="true"></uib-pagination>
                </div>
            </div>
        </footer>
    </section>

</div>